projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
96d1d84
)
net: core: avoid possible NULL pointer dereference
author
[email protected]
<
[email protected]
>
Tue, 16 May 2017 03:07:01 +0000
(
05:07
+0200)
committer
Joe Hershberger
<
[email protected]
>
Fri, 2 Jun 2017 19:44:19 +0000
(14:44 -0500)
Checking if dev is NULL after dereferencing it does not make sense.
Signed-off-by: Heinrich Schuchardt <
[email protected]
>
Acked-by: Joe Hershberger <
[email protected]
>
net/eth-uclass.c
patch
|
blob
|
history
diff --git
a/net/eth-uclass.c
b/net/eth-uclass.c
index c3cc3152a280155dcb6659cb69570034a3b83dea..b659961a5dd4dd883c933f5dad3e3a2754bc2d89 100644
(file)
--- a/
net/eth-uclass.c
+++ b/
net/eth-uclass.c
@@
-181,7
+181,7
@@
int eth_get_dev_index(void)
static int eth_write_hwaddr(struct udevice *dev)
{
- struct eth_pdata *pdata
= dev->platdata
;
+ struct eth_pdata *pdata;
int ret = 0;
if (!dev || !device_active(dev))
@@
-189,6
+189,7
@@
static int eth_write_hwaddr(struct udevice *dev)
/* seq is valid since the device is active */
if (eth_get_ops(dev)->write_hwaddr && !eth_mac_skip(dev->seq)) {
+ pdata = dev->platdata;
if (!is_valid_ethaddr(pdata->enetaddr)) {
printf("\nError: %s address %pM illegal value\n",
dev->name, pdata->enetaddr);